package com.csx.springcloud.configcenter.nacos.sample.controller;

import com.csx.springcloud.configcenter.nacos.sample.service.NacosConfigCenterSampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p> what does this class do ? </p>
 * <p> How does it work ?</p>
 * <p> Why does it do this ?</p>
 *
 * @author cuisongxu
 * @date 2024/12/24 周二 16:30
 */
@RequestMapping("/configcenter/nacos")
@RestController
public class NacosConfigCenterSampleController {


    @Autowired
    private NacosConfigCenterSampleService nacosConfigCenterSampleService;

    @GetMapping("/testAtValueFromNacos")
    public String testAtValueFromNacos() {
        return nacosConfigCenterSampleService.testAtValueFromNacos();
    }

    @GetMapping("/testGetConfigFromNacos")
    public String testGetConfigFromNacos() {
        return nacosConfigCenterSampleService.testGetConfigFromNacos();
    }
    @PostMapping("/testPublishConfigToNacos")
    public String testPublishConfigToNacos() {
        return nacosConfigCenterSampleService.testPublishConfigToNacos();
    }

    @DeleteMapping("/testRemoveConfigFromNacos")
    public String testRemoveConfigFromNacos() {
        return nacosConfigCenterSampleService.testRemoveConfigFromNacos();
    }
}
